{include file='public/head' /}
<style type="text/css">
  .tablelist tr {
    border:1px solid #CFCFCF;
  }
  .tablelist tr td,.tablelist tr th{
    border:1px solid #CFCFCF;
  }
</style>
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main" style="padding:10px">
        <h1 class="page-header" style="color: #3399CC">用户列表
         <button type="button" class="btn btn-danger"  title="添加总代理" onclick="javascript:window.location.href='{:url('admin/users/addsole')}'"><span class="glyphicon glyphicon glyphicon-plus"></span> 添加总代理</button>
         <button type="button" class="btn btn-info"  title="添加用户" onclick="javascript:window.location.href='{:url('admin/users/addusers')}'"><span class="glyphicon glyphicon glyphicon-plus"></span> 添加用户</button>
         <button type="button" style="border:none;outline: none;background: none;">
           <form action="{:url('index')}" method="post">
                  <select name="vip" style="font-size: 13px;height: 35px;border: 1px solid #ddd;border-radius: 3px;">
                    {if condition="$vip eq 1"}
                      <option value="">会员等级</option>
                      <option value="3">总代理</option>   
                      <option value="2">代理</option>    
                      <option value="1" selected>会员</option>
                    {elseif condition="$vip eq 2"}
                      <option value="">会员等级</option>
                      <option value="3">总代理</option>   
                      <option value="2" selected>代理</option>    
                      <option value="1">会员</option>
                    {elseif condition="$vip eq 3"}
                      <option value="">会员等级</option>
                      <option value="3" selected>总代理</option>   
                      <option value="2">代理</option>    
                      <option value="1">会员</option>  
                    {else/}
                      <option value="" selected>会员等级</option>
                      <option value="3">总代理</option>   
                      <option value="2">代理</option>    
                      <option value="1" >会员</option>
                    {/if}
                  </select>&nbsp;
                <input type="submit" class="btn btn-danger" value="确定" style="float: right;margin-top:2px;height: 33px;">
           </form>
          </button>
        </h1>
        <div class="table-responsive" style="margin-top: -30px;border:none;">
           <form action="{:url('admin/users/index')}" method="get" class="navbar-form navbar-right" role="search" style="margin-top: 20px;">
           <div class="input-group">
              <input type="text" class="form-control" autocomplete="off" placeholder="键入关键字搜索" value='{$Think.get.key}' name="key" style="width:190px">
            <span class="input-group">
             <input class="btn btn-primary" type="submit" value="搜索" style="border-radius: 0 3px 3px 0">&nbsp;
             <button class="btn btn-primary" name="all" value="1">显示全部</button>
              </span> </div>
           </form>
          <table class="table table-striped table-hover tablelist">
            <thead>
              <tr style="background-color: #3399CC;color: white">
                <th><span class="glyphicon glyphicon-th-large"></span> <span>选择</span></th>
                <th><span class="glyphicon glyphicon-file"></span> <span>用户名</span></th>
                <th><span class="glyphicon glyphicon-list"></span> <span>会员邀请码</span></th>
                <th><span class="glyphicon glyphicon-list"></span> <span>代理邀请码</span></th>
                <th><span class="glyphicon glyphicon glyphicon-flag"></span> <span>金额</span></th>
                <th><span class="glyphicon glyphicon glyphicon-education"></span> <span>会员等级</span>
                </th>
                <th><span class="glyphicon glyphicon glyphicon-repeat"></span> <span>返水率</span></th>
                <th><span class="glyphicon glyphicon-time"></span> <span>注册时间</span></th>
                <th><span class="glyphicon glyphicon-pencil"></span> <span>操作</span></th>
              </tr>
            </thead>
            <tbody>
              {volist name="data" id="vo"}
              <tr>
                <td><input type="checkbox" class="input-control" value="" />{$vo.uid}</td>
                <td>{$vo.username}</td>
                <td>{$vo.icode1}</td>
                <td>{$vo.icode2}</td>
                <td>{$vo.money}</td>
                <td>{if condition="$vo.vip eq 1"}
                    会员
                    {elseif condition="$vo.vip eq 3"}
                    总代理
                    {else/}
                    代理
                    {/if}
                </td>
                <td>{$vo.return}</td>
                <td>{$vo.createtime}</td>
                <td>
                  <a href="{:url('see',['uid'=>$vo.uid])}" title="查看" rel="1" class="btn btn-danger btn-xs" style="font-size: 10px;"><span class="glyphicon glyphicon-zoom-in"></span> 查看</a>
                  <a href="{:url('edit',['uid'=>$vo.uid])}" title="编辑" rel="1" class="btn btn-primary btn-xs" style="font-size: 10px;"><span class="glyphicon glyphicon-pencil"></span> 编辑</a>
                  <a href="{:url('topup',['uid'=>$vo.uid])}" title="充值" rel="1" class="btn btn-success btn-xs" style="font-size: 10px;"><span class="glyphicon glyphicon-list-alt"></span> 充值</a>        
                  {if condition="$vo.vip gt 1"}
                  <a href="{:url('returns',['uid'=>$vo.uid])}" title="返水率设置" rel="1" class="btn btn-warning btn-xs" style="font-size: 10px;"><span class="glyphicon glyphicon-repeat"></span> 返水率</a>
                  {else/}
                  {/if}
                  {if condition="$vo.vip gt 1"}
                  <a href="{:url('code',['uid'=>$vo.uid])}" title="随机生成邀请码" rel="1" class="btn btn-info btn-xs" style="font-size: 10px;"><span class="glyphicon glyphicon-file"></span> 邀请码</a>
                  {else/}
                  {/if}
                  <a href="{:url('del',['uid'=>$vo.uid])}" title="删除用户" rel="1" class="btn btn-danger btn-xs del" style="font-size: 10px;"><span class="glyphicon glyphicon-trash"></span> 删除</a>
                </td>
              </tr>  
              {/volist}
            </tbody>
          </table>
        </div>
        <footer class="message_footer"  style="margin-top: -10px;">
        {if condition="$all eq 1"}
        {else/}
        <span style="float: left;margin-top: 15px;">第{$data->currentPage()} 页 / 共 {$data->lastPage()} 页 ( 总 共 {$data->total()} 条 记 录 )</span> 
        <div style="float: right;margin-top: -10px;">  
        <div class="page">
        {$data->render()}
        </div>
        </div>
        {/if}
        </footer>
    </div>
  </div>
</section>
</body>
</html>
<script type="text/javascript">
    //单条记录删除
  $('.del').click(function(){
      var del = confirm("你确定要删除吗？");
       if(del == false){
        return false;
      }  
  });
</script>
